{include file="common/head"}
<body class="login-bg">
    <style>
        .logo{width:200px;height:80px;background:url("ADMIN/logo.jpg") no-repeat;}
    </style>
    <div class="login">
        <div class="message"><img width="30px"src="ADMIN/logo.jpg"><h2 style="display: inline;vertical-align: middle;">TSHOP商城后台登录</h2></div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input name="captcha" l placeholder="验证码"  type="text" class="layui-input" style="width:49%; float:left;" class="layui-inline;">
            <img style="width:49%; margin-left: 2%;height: 48px;cursor: pointer;"  src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?'+Math.random();" />
            <hr class="hr15">
            <input class="loginin" value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        </form>
    </div>

    <script type="text/javascript">
        	layui.extend({
				admin: '{/}./static/js/admin'
			});
            layui.use(['form','admin'], function(){
              var form = layui.form,
                  $ = layui.$;
              //监听提交
              form.on('submit(login)', function(data){
                var data=data.field;
                $.post("{:url('Login/index')}",data,function (res) {
                    layui.use('layer',function () {
                        var layer=layui.layer;
                        if(res.code==1){
                            location.href("{:url('Index/index')}");
                        }else{

                        }
                    });
                });
                return false;
              });
              form.verify({
                    pass: [/(.+){6,12}$/, '密码必须6到12位']
                    ,content: function(value){
                        layedit.sync(editIndex);
                    }
                });
            });

    </script>  
    <!-- 底部结束 -->
</body>
</html>